class AmrParser:
    def __init__(self):
        self.data = None
        self.hasHeader = False

    def parse(self, data):
        self.data = data[1:]
        return self.data

    def dump(self, file):
        if not self.hasHeader:
            file.write(b"#!AMR\n")
            self.hasHeader = True
        file.write(self.data)


class AmrwbParser:
    def __init__(self):
        self.data = None
        self.hasHeader = False

    def parse(self, data):
        self.data = data[1:]
        return self.data

    def dump(self, file):
        if not self.hasHeader:
            file.write(b"#!AMR-WB\n")
            self.hasHeader = True
        file.write(self.data)
